package com.sykj.util.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @program: BeautyClub
 * @description:全局异常处理类
 * @author: qiaoli
 * @create: 2020-07-15 09:21
 */
@ControllerAdvice
public class MyExceptionHandler {
    @ExceptionHandler(value =Exception.class)
    public String exceptionHandler(Exception e){
        System.out.println("未知异常！原因是:"+e);
        return e.getMessage();
    }

}
